package com.ljx.search.controller;

import com.ljx.search.service.SearchService;
import com.ljx.search.vo.req.SearchParam;
import com.ljx.search.vo.resp.PageResp;
import com.ljx.search.vo.resp.SearchResp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@Tag(name = "查询接口")
@RestController
@RequestMapping("/search")
public class SearchController {

    @Autowired
    private SearchService searchService;

    @PostMapping
    @Operation(summary = "查询列表")
    public ResponseEntity<PageResp<SearchResp>> searchKeyword(@RequestBody SearchParam param) {

        return ResponseEntity.ok(searchService.search(param));
    }
}
